home *** CD-ROM | disk | FTP | other *** search
/ Aminet 51 / Aminet 51 (2002)(GTI - Schatztruhe)[!][Oct 2002].iso / Aminet / util / arc / xadmasterdev.lha / xad / Include / Autodocs / xadmaster.doc next >
Encoding:
Text File  |  2002-08-20  |  75.2 KB  |  1,900 lines

  1. TABLE OF CONTENTS
  2.  
  3. xadmaster.library/--general--
  4. xadmaster.library/--archive handling--
  5. xadmaster.library/xadAddDiskEntry
  6. xadmaster.library/xadAddFileEntry
  7. xadmaster.library/xadAllocObject
  8. xadmaster.library/xadAllocVec
  9. xadmaster.library/xadCalcCRC16
  10. xadmaster.library/xadCalcCRC32
  11. xadmaster.library/xadConvertDates
  12. xadmaster.library/xadConvertName
  13. xadmaster.library/xadConvertProtection
  14. xadmaster.library/xadCopyMem
  15. xadmaster.library/xadDiskUnArc
  16. xadmaster.library/xadDiskFileUnArc
  17. xadmaster.library/xadFileUnArc
  18. xadmaster.library/xadFreeInfo
  19. xadmaster.library/xadFreeHookAccess
  20. xadmaster.library/xadFreeObject
  21. xadmaster.library/xadGetClientInfo
  22. xadmaster.library/xadGetDiskInfo
  23. xadmaster.library/xadGetErrorText
  24. xadmaster.library/xadGetFilename
  25. xadmaster.library/xadGetInfo
  26. xadmaster.library/xadGetHookAccess
  27. xadmaster.library/xadHookAccess
  28. xadmaster.library/xadHookTagAccess
  29. xadmaster.library/xadRecogFile
  30. xadmaster.library/--tags--
  31. xadmaster.library/--data hooks--
  32. xadmaster.library/--progress hooks--
  33.  
  34. VERSION
  35.         $VER: xadmaster.doc 12.0 (07.08.2002) by SDI
  36.  
  37. xadmaster.library/--general--                   xadmaster.library/--general--
  38.  
  39.     This library gives you an interface to extract data from file or disk
  40.     archives.
  41.  
  42.     When unachiving a archive you need to do following steps always
  43.     1) Allocate a "struct xadArchiveInfo" with a call to
  44.        xadAllocObjectA(XADOBJ_ARCHIVEINFO, 0). This structure is the master
  45.        interface and must not by modified in any way. Nearly all other
  46.        functions you may use need to get the pointer this this structure.
  47.        All data is passed with tags!
  48.  
  49.     2a)Call xadGetInfo() to find out if the input data is archived. If it
  50.        is, the xadArchiveInfo structure is filled with lots of information
  51.        (but the structure may contain empty lists!).
  52.        See xadGetInfo() description to see what you may read and what stuff
  53.        not. One of the input tags must be specified here to specify one 
  54.        of the allowed input stream methods.
  55.  
  56.     2b)Call xadGetDiskInfo() to find out if input data is filesystem data.
  57.  
  58.     Goto step 5 if step 2 returns error code!
  59.  
  60.     3) For every file in a file archive or every disk call xadFileUnArc() or
  61.        xadDiskUnArc() (or xadDiskFileUnArc() if you did step 2b) with one tag
  62.        XAD_ENTRYNUMBER set to wanted entry. One of the output tags must be
  63.        specified here.
  64.        Passwords and other stuff is additionally allowed and sometimes
  65.        required.
  66.  
  67.     4) Call xadFreeInfo() to free the stuff allocated with xadGetInfo() or
  68.        xadGetDiskInfo().
  69.  
  70.     5) Use xadFreeObjectA() to free the xadArchiveInfo structure.
  71.  
  72.     If using xadGetDiskInfo(), there maybe multiple filesystems on one disk.
  73.     If one is detected, do another run and use XAD_STARTCLIENT in step 2b).
  74.     If you detected disk archives, it maybe useful to scan them for file-
  75.     systems as well.
  76.  
  77.     Do not use one xadArchiveInfo file structure for multiple input files!
  78.     
  79.     ANY needed structure must be allocated with xadAllocObject()! None of
  80.     the xadmaster structures can be allocated any other way!
  81.  
  82.     There exist lots of tags, which can be passed to the functions of this
  83.     library. Some of these are repeated in the xadArchiveInfo communication
  84.     structure. Do NEVER set this flags or values directly, but always use
  85.     the corresponding tags. The handling of these elements possibly will
  86.     change, but the tags will stay valid always!
  87.  
  88.     I know there are lots of flags which have long and strange names. The
  89.     method is not so complicated as you may think. They always follow following
  90.     guideline: XADxxY_zzzzz
  91.     xx - short name of their structure (AI - xadArchiveInfo, DI - xadDiskInfo,
  92.          C - xadClient, ...)
  93.     Y  - F for flag or B for bit value
  94.     zz - The flag name itself
  95.     So XADPIF_OVERWRITE is a flag for xadProgressInfo, which is called
  96.     OVERWRITE and XADAIB_OVERWRITE is a bit value for xadArchiveInfo structure.
  97.     
  98.     Also all the structure elements cover a short prefix indicating the name
  99.     of the master structure (xfi for xadFileInfo, xc for xadClient, ...). So
  100.     you can always check if your code is valid by comparing the prefixes.
  101.  
  102. xadmaster.library/--archive handling-- xadmaster.library/--archive handling--
  103.  
  104.     This system supports that many ways of handling archives, that I want to
  105.     describe the most common ones to make understanding easier.
  106.  
  107.     Lets assume, you want to make a tool which gets most out of an archive
  108.     file.
  109.  
  110.     Lets start with an call to xadGetInfo() to find out if it is an valid
  111.     archive and what type it has. If it has entries in xfi_FileInfo, then
  112.     these maybe extracted as normal files with xadUnFile(). This is what
  113.     archivers like LhA and Zip would do.
  114.  
  115.     An archive file may have entries in xfi_DiskInfo (possibly together with
  116.     entries in xfi_FileInfo). Now we can work like DMS and write these entries
  117.     back to a disk or extract the image into a file (which DMS cannot do) with
  118.     xadUnDisk().
  119.  
  120.     But this is not all we can do. Disks usually contain files and normally we
  121.     want these instead of an image. Thus we start a new working stream and
  122.     use xadGetDiskInfo() to recognice the disk as filesystem archiver. This
  123.     can be done either by extracting the image first or by passing the
  124.     XAD_INDISKARCHIVE tag. Disks may contain multiple filesystems (do not blame
  125.     XAD for this, I did not invent it) and thus it can be useful to use
  126.     XAD_STARTCLIENT for secondary calls. Now you get a result structure which
  127.     again contains file and disk entries. See above how to proceed.
  128.  
  129.     Now we have can also have an disk image file (ADF) as input. Thus if
  130.     xadGetInfo() did not bring a result, we can use xadGetDiskInfo() for this
  131.     file. The result are same as for disk archives.
  132.  
  133.     You see, that as a result there are multiple source of extractable files.
  134.     It is not easy to make programs extracting all of them. Also not every
  135.     program will extract all types. There are multiple ways how to work and
  136.     all of them are perfectly valid if you remeber following rules:
  137.     - Every XAD work flow must have 100% control: Never call any GetInfo()
  138.       function with xadArchiveInfo structures already used.
  139.     - Every work flow needs it's own FileHandles (in case of file usage) and
  140.       its own xadArchiveInfo structures.
  141.     - Think of resources passed to XAD as given away. Until the free function
  142.       is called never touch them yourself (which includes passing it to other
  143.       xad functions!). Though input memory structures and filenames maybe
  144.       reused, but filehandles and also hooks usually not.
  145.  
  146. xadmaster.library/xadAddDiskEntry           xadmaster.library/xadAddDiskEntry
  147.  
  148.     NAME
  149.         xadAddDiskEntry - Add disk entry to list of entries (V10)
  150.  
  151.     SYNOPSIS
  152.         result = xadAddDiskEntryA(di, ai, tags)
  153.         D0                        A0  A1   A2
  154.  
  155.         LONG xadAddDiskEntryA(struct xadDiskInfo *, struct xadArchiveInfo *,
  156.              const struct TagItem *)
  157.  
  158.         result = xadAddDiskEntry(di, ai, tag1, ...)
  159.  
  160.         LONG xadAddDiskEntry(struct xadDiskInfo *, struct xadArchiveInfo *,
  161.              Tag, ...)
  162.  
  163.     FUNCTION
  164.         This function adds a newly created struct xadDiskInfo to the list of
  165.         entries and supports a hook call mechanism for user side interaction.
  166.         This should be used always instead of old-style selfmade lists.
  167.         Some important notes:
  168.         a) Never modify the lists yourself, if the two add-functions are used.
  169.         b) Use XADDIF_EXTRACTONBUILD, if the entry can be extracted during
  170.            this function call. Normally this requires the tag XAD_SETINPOS
  171.            also to get an determined file pointer afterwards.
  172.         c) An entry should be finished, when adding it to list. At least the
  173.            public information must be completed. Private information may be
  174.            added later (but this most time means XADDIF_EXTRACTONBUILD is
  175.            impossible).
  176.         d) Always check return code and react on it. This is necessary
  177.            especially to support XADERR_BREAK. In case XADERR_BREAK is
  178.            returned the work should be aborted in any case.
  179.         e) You can add unfinished entries as well, but they need the flag
  180.            XADDIF_ENTRYMAYCHANGE to be set. These entries can be modified
  181.            afterwards, but use this feature very rare! Better make your data
  182.            complete before adding it.
  183.         f) In case an error is returned, the xadDiskInfo structure is already
  184.            added to the list, as errors always occur after adding the entries.
  185.  
  186.     INPUT
  187.         ai      - the master communication structure
  188.         fi      - the file info structure, which should be added to list
  189.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  190.                   XAD_SETINPOS
  191.  
  192.     RESULT
  193.         result  - any of the XADERR codes or zero when all is ok.
  194.  
  195.     SEE ALSO
  196.         libraries/xadmaster.h, xadAddFileEntry(), tags section
  197.  
  198. xadmaster.library/xadAddFileEntry           xadmaster.library/xadAddFileEntry
  199.  
  200.     NAME
  201.         xadAddFileEntry - Add file entry to list of entries (V10)
  202.  
  203.     SYNOPSIS
  204.         result = xadAddFileEntryA(fi, ai, tags)
  205.         D0                        A0  A1   A2
  206.  
  207.         LONG xadAddFileEntryA(struct xadFileInfo *, struct xadArchiveInfo *,
  208.              const struct TagItem *)
  209.  
  210.         result = xadAddFileEntry(fi, ai, tag1, ...)
  211.  
  212.         LONG xadAddFileEntry(struct xadFileInfo *, struct xadArchiveInfo *,
  213.              Tag, ...)
  214.  
  215.     FUNCTION
  216.         This function adds a newly created struct xadFileInfo to the list of
  217.         entries and supports a hook call mechanism for user side interaction.
  218.         This should be used always instead of old-style selfmade lists.
  219.         Some important notes:
  220.         a) Never modify the lists yourself, if the two add-functions are used.
  221.         b) Use XADFIF_EXTRACTONBUILD, if the entry can be extracted during
  222.            this function call. Normally this requires the tag XAD_SETINPOS
  223.            also to get an determined file pointer afterwards.
  224.         c) An entry should be finished, when adding it to list. At least the
  225.            public information must be completed. Private information may be
  226.            added later (but this most time means XADFIF_EXTRACTONBUILD is
  227.            impossible).
  228.         d) Always check return code and react on it. This is necessary
  229.            especially to support XADERR_BREAK. In case XADERR_BREAK is
  230.            returned the work should be aborted in any case.
  231.         e) You can add unfinished entries as well, but they need the flag
  232.            XADFIF_ENTRYMAYCHANGE to be set. These entries can be modified
  233.            afterwards, but use this feature very rare! Better make your data
  234.            complete before adding it.
  235.         f) In case an error is returned, the xadFileInfo structure is already
  236.            added to the list, as errors always occur after adding the entries.
  237.  
  238.     INPUT
  239.         ai      - the master communication structure
  240.         fi      - the file info structure, which should be added to list
  241.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  242.                   XAD_SETINPOS, XAD_INSERTDIRSFIRST
  243.  
  244.     RESULT
  245.         result  - any of the XADERR codes or zero when all is ok.
  246.  
  247.     SEE ALSO
  248.         libraries/xadmaster.h, xadAddDiskEntry(), tags section
  249.  
  250. xadmaster.library/xadAllocObject             xadmaster.library/xadAllocObject
  251.  
  252.     NAME
  253.         xadAllocObject - Allocate memory for all xad related structures
  254.  
  255.     SYNOPSIS
  256.         ptr = xadAllocObjectA(type, tags)
  257.         D0                    D0    A0
  258.  
  259.         APTR xadAllocObjectA(ULONG, const struct TagItem *)
  260.  
  261.         ptr = xadAllocObject(type, tag1, ...)
  262.  
  263.         APTR xadAllocObject(ULONG, Tag, ...)
  264.  
  265.     FUNCTION
  266.         This function allocates the memory of a needed xad related
  267.         structure and initializes it. You need to use this function to
  268.         allocate the structures. Any other way of allocating is not
  269.         allowed.
  270.     The structures are initialized, which means filled with zero in
  271.     nearly all cases. Fields allocated with XAD_OBJxxx are filled with
  272.     corresponding pointers and are cleared also. It is NOT necessary
  273.     to leave these pointers intact when calling xadFreeObject().
  274.  
  275.     INPUT
  276.         type    - in libraries/xadmaster.h defined XADOBJ_... types.
  277.                   For example XADOBJ_FILEINFO allocates xadFileInfo
  278.                   structure.
  279.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  280.                   XAD_OBJNAMESIZE, XAD_OBJCOMMENTSIZE, XAD_OBJBLOCKENTRIES,
  281.                   XAD_OBJPRIVINFOSIZE
  282.  
  283.     RESULT
  284.         ptr     - Pointer to required structure or 0 when an error occured.
  285.  
  286.     SEE ALSO
  287.         libraries/xadmaster.h, xadFreeObject(), tags section
  288.  
  289. xadmaster.library/xadAllocVec                   xadmaster.library/xadAllocVec
  290.  
  291.     NAME
  292.         xadAllocVec - Allocate memory for xad related stuff (V2)
  293.  
  294.     SYNOPSIS
  295.         ptr = xadAllocVec(size, flags)
  296.         D0                 D0     D1
  297.  
  298.         APTR xadAllocVec(ULONG, ULONG)
  299.  
  300.     FUNCTION
  301.         This function allocates memory for stuff related to xad. It is like
  302.         exec.library AllocVec() function, but uses xadFreeObject() to free
  303.         stuff and reduces the need for SysBase in clients. It's the prefered
  304.         method to allocate memory in clients.
  305.  
  306.     INPUT
  307.         size    - The size in bytes.
  308.         flags   - Normal MEMF_... flags defined in exec/types.h
  309.  
  310.     RESULT
  311.         ptr     - Pointer to required memory or 0 when an error occured.
  312.  
  313.     SEE ALSO
  314.         libraries/xadmaster.h, exec/types.h, exec.doc/AllocMem(),
  315.         xadFreeObject(),
  316.  
  317. xadmaster.library/xadCalcCRC16                 xadmaster.library/xadCalcCRC16
  318.  
  319.     NAME
  320.         xadCalcCRC16 - calculate a 16 bit CRC
  321.  
  322.     SYNOPSIS
  323.         crc16 = xadCalcCRC16(id, init, size, buffer)
  324.         D0                   D0   D1    D2     A0
  325.  
  326.         UWORD xadCalcCRC16(UWORD, UWORD, ULONG, STRPTR)
  327.  
  328.     FUNCTION
  329.         This function calculates a 16 bit CRC. It is possible to choose the
  330.         calculation method by parameter id.
  331.  
  332.         The CRC calculation uses a table built with following function:
  333.         void MakeCRC16(UWORD *buf, ULONG ID)
  334.         {
  335.           UWORD i, j, k;
  336.  
  337.           for(i = 0; i < 256; ++i)
  338.           {
  339.             k = i;
  340.  
  341.             for(j = 0; j < 8; ++j)
  342.             {
  343.               if(k & 1)
  344.                 k = (k >> 1) ^ ID;
  345.               else
  346.                 k >>= 1;
  347.             }
  348.             buf[i] = k;
  349.           }
  350.         }
  351.  
  352.         The used calculation routine is like that:
  353.         crc = init;
  354.         while(size--)
  355.           crc = tab[(crc ^ *buffer++) & 0xFF] ^ (crc >> 8);
  356.  
  357.         ID's defined in xadmaster.h use a default table. All others build the
  358.         table on the fly.
  359.         XADCRC16_ID1: (0xA001) - Used by DMS, Arc, ...
  360.  
  361.     INPUT
  362.         id      - The table creation ID (maybe XADCR16_ID value)
  363.         init    - The initial value for CRC calculation.
  364.         size    - The input buffer size.
  365.         buffer  - A pointer to the input buffer.
  366.  
  367.     RESULT
  368.         crc16   - The calculated CRC value.
  369.  
  370.     SEE ALSO
  371.         libraries/xadmaster.h, xadCalcCRC32
  372.  
  373. xadmaster.library/xadCalcCRC32                 xadmaster.library/xadCalcCRC32
  374.  
  375.     NAME
  376.         xadCalcCRC32 - calculate a 32 bit CRC
  377.  
  378.     SYNOPSIS
  379.         crc32 = xadCalcCRC32(id, init, size, buffer)
  380.         D0                   D0   D1    D2     A0
  381.  
  382.         ULONG xadCalcCRC32(ULONG, ULONG, ULONG, STRPTR)
  383.  
  384.     FUNCTION
  385.         This function calculates a 32 bit CRC. It is possible to choose the
  386.         calculation method by parameter id.
  387.  
  388.         The CRC calculation uses a table built with following function:
  389.         void MakeCRC32(ULONG *buf, ULONG ID)
  390.         {
  391.           ULONG i, j, k;
  392.  
  393.           for(i = 0; i < 256; ++i)
  394.           {
  395.             k = i;
  396.  
  397.             for(j = 0; j < 8; ++j)
  398.             {
  399.               if(k & 1)
  400.                 k = (k >> 1) ^ ID;
  401.               else
  402.                 k >>= 1;
  403.             }
  404.             buf[i] = k;
  405.           }
  406.         }
  407.  
  408.         The used calculation routine is like that:
  409.         crc = init;
  410.         while(size--)
  411.           crc = tab[(crc ^ *buffer++) & 0xFF] ^ (crc >> 8);
  412.  
  413.         ID's defined in xadmaster.h use a default table. All others build the
  414.         table on the fly.
  415.         XADCRC32_ID2: (0xEDB88320) - Used by Zoom, Zip, LZX, ...
  416.  
  417.     INPUT
  418.         id      - The table creation ID (maybe XADCR32_ID value)
  419.         init    - The initial value for CRC calculation.
  420.         size    - The input buffer size.
  421.         buffer  - A pointer to the input buffer.
  422.  
  423.     RESULT
  424.         crc32   - The calculated CRC value.
  425.  
  426.     SEE ALSO
  427.         libraries/xadmaster.h, xadCalcCRC16
  428.  
  429. xadmaster.library/xadConvertDates           xadmaster.library/xadConvertDates
  430.  
  431.     NAME
  432.         xadConvertDates - convert between date storage methods
  433.  
  434.     SYNOPSIS
  435.         result = xadConvertDatesA(tags)
  436.         D0                         A0
  437.  
  438.         LONG xadConvertDatesA(const struct TagItem *)
  439.  
  440.         result = xadConvertDates(tag1, ...)
  441.  
  442.         LONG xadConvertDates(Tag, ...)
  443.  
  444.     FUNCTION
  445.         This function can be used to transform date and time between
  446.         different storage systems. One of the input tags must be specified.
  447.         Output tags may be specified multiple. The date information is
  448.         based on Gregorian calendar. Some systems can store a wider range
  449.         of dates than others. If a date produces an overflow or an
  450.         underflow for a special date, the highest/lowest valid date is used
  451.         (e.g. for timevalues 0x00000000 or 0xFFFFFFFF).
  452.  
  453.         The XAD_MAKEGMTDATE and XAD_MAKELOCALDATE tags need locale.library
  454.         to get the offset to local time. If locale.library cannot be opened
  455.         the offset is set to 0.
  456.  
  457.         XAD_DATECURRENTTIME can be used to get the current system date and
  458.         time.
  459.  
  460.         WeekDay information is ignored for input and always recalculated.
  461.         The calculation routines use full range of available variable space,
  462.         so f.e. a Unix date 1.1.1970 00:00:00 (value 0x00000000) with a
  463.         UTC offset of -30 min produces 31.12.1968 23:30:00 (which cannot be
  464.         stored as UNIX time value, but only as xadDate structure)!.
  465.  
  466.     INPUT
  467.         ai      - the master communication structure
  468.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  469.                   XAD_DATEUNIX, XAD_DATEAMIGA, XAD_DATEMAC, XAD_DATEDATESTAMP,
  470.                   XAD_DATEXADDATE, XAD_DATECLOCKDATA, XAD_DATECURRENTTIME,
  471.                   XAD_DATEMSDOS, XAD_DATECPM, XAD_DATECPM2, XAD_DATEISO9660,
  472.                   XAD_GETDATEUNIX, XAD_GETDATEAMIGA, XAD_GETDATEDATESTAMP,
  473.                   XAD_GETDATEXADDATE, XAD_GETDATECLOCKDATA, XAD_GETDATEMSDOS,
  474.                   XAD_GETDATEMAC, XAD_GETDATECPM, XAD_GETDATECPM2,
  475.                   XAD_GETDATEISO9660
  476.                   XAD_MAKEGMTDATE, XAD_MAKELOCALDATE
  477.  
  478.     RESULT
  479.         result  - any of the XADERR codes or zero when all is ok.
  480.  
  481.     SEE ALSO
  482.         libraries/xadmaster.h, tags section
  483.  
  484. xadmaster.library/xadConvertName             xadmaster.library/xadConvertName
  485.  
  486.     NAME
  487.         xadConvertName - convert strings between character sets (V12)
  488.  
  489.     SYNOPSIS
  490.         string = xadConvertNameA(charset, tags)
  491.         D0                         D0      A0
  492.  
  493.         STRPTR xadConvertNameA(ULONG, const struct TagItem *)
  494.  
  495.         string = xadConvertName(charset, tag1, ...)
  496.  
  497.         STRPTR xadConvertName(ULONG, Tag, ...);
  498.  
  499.     FUNCTION
  500.     This function converts one or more input strings into one resulting
  501.     XAD string object with the given charset. For clients the only
  502.     acceptable charset is CHARSET_HOST!
  503.  
  504.     All other programs can get CHARSET_ASCII, CHARSET_ISO_8859_1,
  505.         CHARSET_HOST, CHARSET_UNICODE_UCS2_HOST,
  506.         CHARSET_UNICODE_UCS2_BIGENDIAN, CHARSET_UNICODE_UCS2_LITTLENDIAN
  507.         as output.
  508.  
  509.     For input the CHARSET_ISO_8859_1 is default. This can be changed
  510.     by using XAD_CHARACTERSET.
  511.  
  512.     The XAD_ERRORCODE tag is very useful to find out if conversion had
  513.     errors. Only fatal errors cause return of a zero value! There also
  514.     may be errorcodes in case a string is returned.
  515.  
  516.     INPUT
  517.         charset - the destination characterset
  518.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  519.           XAD_ADDPATHSEPERATOR, XAD_CHARACTERSET, XAD_ERRORCODE,
  520.           XAD_CSTRING, XAD_PATHSEPERATOR, XAD_PSTRING,
  521.           XAD_STRINGSIZE, XAD_XADSTRING
  522.  
  523.     RESULT
  524.         string  - an XAD string object
  525.  
  526.     SEE ALSO
  527.         libraries/xadmaster.h, tags section
  528.  
  529. xadmaster.library/xadConvertProtection xadmaster.library/xadConvertProtection
  530.  
  531.     NAME
  532.         xadConvertProtection - convert between different protection bits (V4)
  533.  
  534.     SYNOPSIS
  535.         result = xadConvertProtectionA(tags)
  536.         D0                              A0
  537.  
  538.         LONG xadConvertProtectionA(const struct TagItem *)
  539.  
  540.         result = xadConvertProtection(tag1, ...)
  541.  
  542.         LONG xadConvertProtection(Tag, ...)
  543.  
  544.     FUNCTION
  545.         This function can be used to transform protection bits of different
  546.         operating systems.
  547.  
  548.     The protection values are initialised with the Amiga standard values
  549.     "rwed". These bits are modified by specified XAD_PROTxxx tags, but
  550.     only the bits supported by that format (e.g. most systems do not
  551.     support "s" or "p").
  552.  
  553.     The taglist must contain at least one of the XAD_GETPROTxxx tags.
  554.     To store the elements XAD_GETPROTFILEINFO is best choice, as it
  555.     takes care of additional bits for different systems. Always supply
  556.     as much protection information as possible. If informations for all
  557.     3 systems is given, call the function in the order "msdos, amiga,
  558.     unix" to get best results.
  559.  
  560.     The stored result is not affected by the position of the
  561.     XAD_GETPROTxxx tag in the list of tags! The result are always the
  562.     bits, which are computed of all input tags.
  563.  
  564.     INPUT
  565.         ai      - the master communication structure
  566.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  567.                   XAD_PROTAMIGA, XAD_PROTFILEINFO, XAD_PROTMSDOS,
  568.                   XAD_PROTUNIX, XAD_GETPROTAMIGA, XAD_GETPROTFILEINFO,
  569.                   XAD_GETPROTMSDOS, XAD_GETPROTUNIX
  570.     RESULT
  571.         result  - any of the XADERR codes or zero when all is ok.
  572.  
  573.     SEE ALSO
  574.         libraries/xadmaster.h, tags section
  575.  
  576. xadmaster.library/xadCopyMem                     xadmaster.library/xadCopyMem
  577.  
  578.     NAME
  579.         xadCopyMem - copies one data block to another position (V2)
  580.  
  581.     SYNOPSIS
  582.         xadCopyMem(src, dest, size)
  583.                     A0   A1    D0
  584.  
  585.         void xadCopyMem(APTR, APTR, ULONG)
  586.  
  587.     FUNCTION
  588.         xadCopyMem is a general purpose memory copy function. It can deal
  589.         any length and its pointers on any alignment. It tries to optimize
  590.         the copy operation, when alignment and size allow longword copies.
  591.  
  592.         Overlapping copies are supported in both directions.
  593.  
  594.         The internal implementation of this function will change from
  595.         system to system and version to version.
  596.         This copy function is not highly optimized, but should fit any needs
  597.         around xadmaster.library!
  598.  
  599.     INPUT
  600.         src     - the source buffer
  601.         dest    - the destination buffer
  602.         size    - the size to copy
  603.  
  604.     RESULT
  605.         none
  606.  
  607.     SEE ALSO
  608.         libraries/xadmaster.h, exec.library/CopyMem()
  609.  
  610. xadmaster.library/xadDiskUnArc                 xadmaster.library/xadDiskUnArc
  611.  
  612.     NAME
  613.         xadDiskUnArc - the master function for unarchiving disks
  614.  
  615.     SYNOPSIS
  616.         result = xadDiskUnArcA(ai, tags)
  617.         D0                    A0   A1
  618.  
  619.         LONG xadDiskUnArcA(struct xadArchiveInfo *, const struct TagItem *)
  620.  
  621.         result = xadDiskUnArc(ai, tag1, ...)
  622.  
  623.         LONG xadDiskUnArc(struct xadArchiveInfo *, Tag, ...)
  624.  
  625.     FUNCTION
  626.         This function dearchives a disk archive. It can be called after
  627.         a successful call to xadGetInfo(). At least the tag XAD_ENTRYNUMBER
  628.         and one of the output tags needs to be supplied. When a progress
  629.         hook is supplied, this can be used for questioning for overwriting
  630.         and ignoring of drive geometry and for status displays.
  631.         Normally disk archivers will have only one entry, but there may
  632.         be multiple disk archives.
  633.  
  634.         When this function returns, the supplied output data streams may
  635.         be used in any way (files, memory). The library does not even know
  636.         that they exist! The xadmaster.library cannot be used to rename,
  637.         protect, comment or delete that stuff!
  638.  
  639.     INPUT
  640.         ai      - the master communication structure
  641.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  642.           XAD_ENTRYNUMBER, XAD_HIGHCYLINDER, XAD_LOWCYLINDER,
  643.           output tags of xadGetHookAccess()
  644.  
  645.     RESULT
  646.         result  - any of the XADERR codes or zero when all is ok.
  647.  
  648.     SEE ALSO
  649.         libraries/xadmaster.h, xadFileUnArc(), xadGetInfo(),
  650.         xadGetHookAccess(), tags section
  651.  
  652. xadmaster.library/xadDiskFileUnArc         xadmaster.library/xadDiskFileUnArc
  653.  
  654.     NAME
  655.         xadDiskFileUnArc - for unarchiving files from disk image (V4)
  656.  
  657.     SYNOPSIS
  658.         result = xadDiskFileUnArcA(ai, tags)
  659.         D0                         A0   A1
  660.  
  661.         LONG xadDiskFileUnArcA(struct xadArchiveInfo *, const struct TagItem *)
  662.  
  663.         result = xadDiskFileUnArc(ai, tag1, ...)
  664.  
  665.         LONG xadDiskFileUnArc(struct xadArchiveInfo *, Tag, ...)
  666.  
  667.     FUNCTION
  668.         This function extracts a file from disk images. It can be called
  669.         after a succesful call to xadGetDiskInfo(). At least the tag
  670.         XAD_ENTRYNUMBER and one of the output tags needs to be supplied.
  671.         When a progress hook is supplied, this can be used for questioning
  672.         for overwriting and for status displays.
  673.         This function needs to be called for every file, which should be
  674.         unarchived.
  675.  
  676.         When this function returns, the supplied output data streams may
  677.         be used in any way (files, memory). The library does not even know
  678.         that they exist! The xadmaster.library cannot be used to rename,
  679.         protect, comment or delete that stuff!
  680.  
  681.     INPUT
  682.         ai      - the master communication structure
  683.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  684.           XAD_ENTRYNUMBER, output tags of xadGetHookAccess()
  685.  
  686.     RESULT
  687.         result  - any of the XADERR codes or zero when all is ok.
  688.  
  689.     SEE ALSO
  690.         libraries/xadmaster.h, xadGetDiskInfo(), xadGetHookAccess(),
  691.         tags section
  692.  
  693. xadmaster.library/xadFileUnArc                 xadmaster.library/xadFileUnArc
  694.  
  695.     NAME
  696.         xadFileUnArc - the master function for unarchiving disks
  697.  
  698.     SYNOPSIS
  699.         result = xadFileUnArcA(ai, tags)
  700.         D0                    A0   A1
  701.  
  702.         LONG xadFileUnArcA(struct xadArchiveInfo *, const struct TagItem *)
  703.  
  704.         result = xadFileUnArc(ai, tag1, ...)
  705.  
  706.         LONG xadFileUnArc(struct xadArchiveInfo *, Tag, ...)
  707.  
  708.     FUNCTION
  709.         This function dearchives a file archive entry. It can be called
  710.         after a succesful call to xadGetInfo(). At least the tag
  711.         XAD_ENTRYNUMBER and one of the output tags needs to be supplied.
  712.         When a progress hook is supplied, this can be used for questioning
  713.         for overwriting and for status displays.
  714.         This function needs to be called for every file, which should be
  715.         unarchived. Best is to do unarchiving in direction giving by
  716.         info structure, because some archivers crunch multiple files in one
  717.         pass and the unarchiver needs to compress and buffer the whole
  718.         pass to get one file.
  719.  
  720.         When this function returns, the supplied output data streams may
  721.         be used in any way (files, memory). The library does not even know
  722.         that they exist! The xadmaster.library cannot be used to rename,
  723.         protect, comment or delete that stuff!
  724.  
  725.     INPUT
  726.         ai      - the master communication structure
  727.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  728.           XAD_ENTRYNUMBER, output tags of xadGetHookAccess()
  729.  
  730.     RESULT
  731.         result  - any of the XADERR codes or zero when all is ok.
  732.  
  733.     SEE ALSO
  734.         libraries/xadmaster.h, xadDiskUnArc(), xadGetInfo(),
  735.         xadGetHookAcess(), tags section
  736.  
  737. xadmaster.library/xadFreeInfo                   xadmaster.library/xadFreeInfo
  738.  
  739.     NAME
  740.         xadFreeInfo - free stuff built and allocated with xadGetInfo()
  741.  
  742.     SYNOPSIS
  743.         xadFreeInfo(ai)
  744.                     A0
  745.  
  746.         void xadFreeInfo(struct xadArchiveInfo *)
  747.  
  748.     FUNCTION
  749.         Frees all the stuff built and allocated by a call to xadGetInfo() or
  750.         xadGetDiskInfo(). You always need to call this after your work with
  751.         a certain input file is finished.
  752.  
  753.     INPUTS
  754.         ai      - the master communication structure
  755.  
  756.     SEE ALSO
  757.         libraries/xadmaster.h, xadGetInfo(), xadGetDiskInfo()
  758.  
  759. xadmaster.library/xadFreeHookAccess       xadmaster.library/xadFreeHookAccess
  760.  
  761.     NAME
  762.         xadFreeHookAccess - free stuff allocated with xadGetHooAccess() (V8)
  763.  
  764.     SYNOPSIS
  765.         xadFreeHookAccessA(ai, tags)
  766.                           A0   A1
  767.  
  768.         void xadFreeHookAccessA(struct xadArchiveInfo *, const struct TagItem *)
  769.  
  770.         xadFreeHookAccess(ai, tag1, ...)
  771.  
  772.         void xadFreeHookAccess(struct xadArchiveInfo *, Tag, ...)
  773.  
  774.     FUNCTION
  775.         Frees all the stuff built and allocated by a call to xadGetHookAccess().
  776.         You always need to call this after your work with the hooks is finished.
  777.  
  778.     INPUTS
  779.         ai      - the master communication structure
  780.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  781.                   XAD_WASERROR
  782.  
  783.     SEE ALSO
  784.         libraries/xadmaster.h, xadGetHookAccess()
  785.  
  786. xadmaster.library/xadFreeObject               xadmaster.library/xadFreeObject
  787.  
  788.     NAME
  789.         xadFreeObject - Frees structures allocated with xadAllocObject() or
  790.                         xadAllocVec()
  791.  
  792.     SYNOPSIS
  793.         xadFreeObjectA(object, tags)
  794.                          A0      A1
  795.  
  796.         void xadFreeObjectA(APTR, const struct TagItem *)
  797.  
  798.         xadFreeObject(object, tag1, ...)
  799.  
  800.         void xadFreeObject(APTR, Tag, ...)
  801.  
  802.     FUNCTION
  803.         Frees object allocated by xadAllocObject() or xadAllocVec(). Do not call
  804.         for objects allocated in any other way.
  805.         This function frees ALL memory which was allocated by xadAllocObject(),
  806.         but only this memory. This means all name buffers and other related
  807.         structures are freed, but if you replace pointers, your replacements
  808.         get not freed. This function does not need the original pointers to be
  809.         in the related positions, as the buffer size is stored elsewhere.
  810.  
  811.     INPUTS
  812.         object  - object allocated with xadAllocObject() or xadAllocVec()
  813.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  814.                   currently none
  815.  
  816.     SEE ALSO
  817.         libraries/xadmaster.h, xadAllocObject(), xadAllocVec(), tags section
  818.  
  819. xadmaster.library/xadGetClientInfo         xadmaster.library/xadGetClientInfo
  820.  
  821.     NAME
  822.         xadGetClientInfo - Get list of active clients
  823.  
  824.     SYNOPSIS
  825.         ptr = xadGetClientInfo()
  826.         D0
  827.  
  828.         struct xadClient *xadGetClientInfo(void)
  829.  
  830.     FUNCTION
  831.         This function returns a list of all active clients. It can be used
  832.         to show information about the library. The list is read only and
  833.         cannot be modified!
  834.  
  835.     RESULT
  836.         ptr     - Pointer to first client in the list.
  837.  
  838.     SEE ALSO
  839.         libraries/xadmaster.h
  840.  
  841. xadmaster.library/xadGetDiskInfo             xadmaster.library/xadGetDiskInfo
  842.  
  843.     NAME
  844.         xadGetDiskInfo - get information about files from disk image (V4)
  845.  
  846.     SYNOPSIS
  847.         result = xadGetDiskInfoA(ai, tags)
  848.         D0                       A0   A1
  849.  
  850.         LONG xadGetDiskInfoA(struct xadArchiveInfo *, const struct TagItem *)
  851.  
  852.         result = xadGetDiskInfo(ai, tag1, ...)
  853.  
  854.         LONG xadGetDiskInfo(struct xadArchiveInfo *, Tag, ...)
  855.  
  856.     FUNCTION
  857.         This function returns all useful information about a specified
  858.         disk image filesytem structure. The information about files,
  859.         directories and links are stored in xai_FileInfo list. You may
  860.         call xadDiskFileUnArc() to extract files from the disk image.
  861.  
  862.         The data must be freed by a call to xadFreeInfo(). After that the
  863.         xadArchiveInfo structure must be freed and NEVER be used again!
  864.  
  865.         The supplied input stream is used and must be valid and unmodified
  866.         until xadFreeInfo() is called. Only the master functions are allowed
  867.         to access the stream, but it is guaranteed to be unmodified!
  868.  
  869.     INPUT
  870.         ai      - the master communication structure
  871.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  872.           XAD_STARTCLIENT, XAD_NOEMPTYERROR, XAD_NOEXTERN,
  873.                   XAD_IGNOREFLAGS, XAD_ONLYFLAGS,
  874.           input tags of xadGetHookAccess()
  875.  
  876.     RESULT
  877.         result  - any of the XADERR codes or zero when all is ok.
  878.  
  879.     SEE ALSO
  880.         libraries/xadmaster.h, xadFreeInfo(), xadDiskFileUnArc(),
  881.         xadGetInfo(), xadGetHookAccess(), tags section
  882.  
  883. xadmaster.library/xadGetErrorText           xadmaster.library/xadGetErrorText
  884.  
  885.     NAME
  886.         xadGetErrorText - Get error string from an error number
  887.  
  888.     SYNOPSIS
  889.         ptr = xadGetErrorText(errnum)
  890.         D0                    D0
  891.  
  892.         STRPTR xadGetErrorText(ULONG)
  893.  
  894.     FUNCTION
  895.         This function returns the error string related to the supplied
  896.         error number. This string is valid as long as xadmaster.library
  897.         is opened, so when needed any longer time it must be copied.
  898.  
  899.     INPUT
  900.         errnum  - in libraries/xadmaster.h defined XADERR_... numbers.
  901.  
  902.     RESULT
  903.         ptr     - Pointer to required string.
  904.  
  905.     SEE ALSO
  906.         libraries/xadmaster.h
  907.  
  908. xadmaster.library/xadGetFilename             xadmaster.library/xadGetFilename
  909.  
  910.     NAME
  911.         xadGetFilename - Create a filename from path and name part (V12)
  912.  
  913.     SYNOPSIS
  914.         result = xadGetFilenameA(buffersize, buffer, path, name, tags)
  915.         D0                           D0        A0     A1    A2    A3
  916.  
  917.         LONG xadGetFilenameA(ULONG, STRPTR, STRPTR, STRPTR, const struct TagItem *)
  918.  
  919.         result = xadGetFilename(buffersize, buffer, path, name, tag1, ...)
  920.  
  921.         LONG xadGetFilenameA(ULONG, STRPTR, STRPTR, STRPTR, Tag, ...)
  922.  
  923.     FUNCTION
  924.     This function creates a pathname from two name parts (path and name
  925.     arguments). It can be compared to dos.library function AddPart().
  926.     The tags can be used to change behaviour of the function.
  927.  
  928.         The destination buffer can be equal to the supplied path part.
  929.  
  930.     When XADERR_SHORTBUFFER is returned the filename is truncated to fit
  931.     into the buffer (including the zero byte).
  932.  
  933.     INPUT
  934.         buffersize - size of supplied destination buffer
  935.         buffer     - the destination buffer to store name
  936.         path       - path part of filename
  937.         name       - name part of filename
  938.         tags       - Pointer to an array of struct TagItem. Recognized tags:
  939.                      XAD_NOLEADINGPATH, XAD_NOTRAILINGPATH,
  940.                      XAD_MASKCHARACTERS, XAD_MASKINGCHAR,
  941.                      XAD_REQUIREDBUFFERSIZE
  942.  
  943.     RESULT
  944.         result  - any of the XADERR codes or zero when all is ok.
  945.  
  946.     SEE ALSO
  947.         libraries/xadmaster.h, tags section
  948.  
  949. xadmaster.library/xadGetInfo                     xadmaster.library/xadGetInfo
  950.  
  951.     NAME
  952.         xadGetInfo - get information about an archive
  953.  
  954.     SYNOPSIS
  955.         result = xadGetInfoA(ai, tags)
  956.         D0                   A0   A1
  957.  
  958.         LONG xadGetInfoA(struct xadArchiveInfo *, const struct TagItem *)
  959.  
  960.         result = xadGetInfo(ai, tag1, ...)
  961.  
  962.         LONG xadGetInfo(struct xadArchiveInfo *, Tag, ...)
  963.  
  964.     FUNCTION
  965.         This function returns all useful information about a specified
  966.         archive. It opens the archive for working. You may call
  967.         xadFileUnArc() or xadDiskUnArc() for the included entries
  968.         after a successful call to xadGetInfo(). The data must be freed
  969.         by a call to xadFreeInfo(). After that the xadArchiveInfo structure
  970.         must be freed and NEVER be used again! For archives encrypting
  971.         the information parts as well, you need to specify XAD_PASSWORD.
  972.         This password can be used for all calls to a unarchiving function,
  973.         but is overwritten by XAD_PASSWORD tag argument (only for the
  974.         entry with XAD_PASSWORD specified). Check and parse the elements
  975.         xai_FileInfo and xai_DiskInfo. You may expect both lists to have
  976.         valid entries or also both to be empty. Parsing the lists is the
  977.         normal way to do anything.
  978.  
  979.         The supplied input stream is used and must be valid and unmodified
  980.         until xadFreeInfo() is called. Only the current client is allowed to
  981.         access the stream, but it is guaranteed to be unmodified!
  982.  
  983.     INPUT
  984.         ai      - the master communication structure
  985.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  986.           XAD_NOEXTERN, XAD_IGNOREFLAGS, XAD_ONLYFLAGS,
  987.           input tags of xadGetHookAccess()
  988.  
  989.     RESULT
  990.         result  - any of the XADERR codes or zero when all is ok.
  991.  
  992.     SEE ALSO
  993.         libraries/xadmaster.h, xadFreeInfo(), xadDiskUnArc(),
  994.         xadFileUnArc(), xadGetHookAccess(), tags section
  995.  
  996. xadmaster.library/xadGetHookAccess         xadmaster.library/xadGetHookAccess
  997.  
  998.     NAME
  999.         xadGetHookAccess - initialize input and output hooks
  1000.  
  1001.     SYNOPSIS
  1002.         result = xadGetHookAccessA(ai, tags)
  1003.         D0                         A0   A1
  1004.  
  1005.         LONG xadGetHookAccessA(struct xadArchiveInfo *, const struct TagItem *)
  1006.  
  1007.         result = xadGetHookAccess(ai, tag1, ...)
  1008.  
  1009.         LONG xadGetHookAccess(struct xadArchiveInfo *, Tag, ...)
  1010.  
  1011.     FUNCTION
  1012.         This function opens input and output hooks. The data must be freed
  1013.         by a call to xadFreeHookAccess(). After that the xadArchiveInfo
  1014.         structure must be freed and NEVER be used again!
  1015.  
  1016.         The supplied input and output streams are used and must be valid
  1017.         and unmodified until xadFreeHookAccess() is called. Only the
  1018.         current client is allowed to access the streams, but the input
  1019.         stream is guaranteed to be unmodified!
  1020.  
  1021.     You may use xadHookAccess() and xadHookTagAccess() to access the
  1022.     streams.
  1023.  
  1024.     INPUT
  1025.         ai      - the master communication structure
  1026.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  1027.                   XAD_INSIZE, XAD_INFILENAME, XAD_INFILEHANDLE,
  1028.                   XAD_INMEMORY, XAD_INHOOK, XAD_INSPLITTED, 
  1029.                   XAD_INXADSTREAM, XAD_INDISKARCHIVE, XAD_INDEVICE,
  1030.           XAD_OUTFILEHANDLE, XAD_OUTFILENAME, XAD_OUTHOOK,
  1031.           XAD_OUTMEMORY, XAD_OUTSIZE, XAD_OUTXADSTREAM,
  1032.           XAD_OUTDEVICE,
  1033.           XAD_PROGRESSHOOK, XAD_VERIFY, XAD_FORMAT,
  1034.           XAD_OVERWRITE, XAD_MAKEDIRECTORY, XAD_NOKILLPARTIAL,
  1035.           XAD_IGNOREGEOMETRY, XAD_USESECTORLABELS,
  1036.           XAD_PASSWORD
  1037.  
  1038.     RESULT
  1039.         result  - any of the XADERR codes or zero when all is ok.
  1040.  
  1041.     SEE ALSO
  1042.         libraries/xadmaster.h, xadFreeHookAccess(), xadHookAccess(),
  1043.         xadHookTagAccess(), tags section
  1044.  
  1045. xadmaster.library/xadHookAccess               xadmaster.library/xadHookAccess
  1046.  
  1047.     NAME
  1048.         xadHookAccess - a client only function to get/store data
  1049.  
  1050.     SYNOPSIS
  1051.         result = xadHookAccess(command, data, buffer, ai)
  1052.         D0                       D0      D1     A0    A1
  1053.  
  1054.         LONG xadHookAccess(ULONG, LONG, APTR, struct xadArchiveInfo *)
  1055.  
  1056.     FUNCTION
  1057.         This function is for external clients only. It is needed to get
  1058.         data, store results and seek in input or output. There are 5
  1059.         commands XADAC_READ, XADAC_WRITE, XADAC_COPY, XADAC_INPUTSEEK,
  1060.         XADAC_OUTPUTSEEK to do that. This function updates the xai_InPos,
  1061.         xai_OutPos and xai_OutSize fields in xadArchiveInfo structure. The
  1062.         seek commands and the copy command should set buffer parameter to
  1063.         zero. Seek's and reads should not exceed the file borders! The
  1064.         client knows position and size, so checks are possible before doing
  1065.         wrong commands.
  1066.  
  1067.         See also xadHookTagAccess() function, which allows to pass tags for
  1068.         deeper control, which is necessary sometimes.
  1069.  
  1070.     INPUT
  1071.         command - one of the XADAC commands to control hook
  1072.         data    - the required data, mostly a size value
  1073.         buffer  - the input/output buffer for read and write
  1074.         ai      - the master communication structure
  1075.  
  1076.     RESULT
  1077.         result  - any of the XADERR codes or zero when all is ok.
  1078.  
  1079.     SEE ALSO
  1080.         libraries/xadmaster.h, xadHookTagAccess()
  1081.  
  1082. xadmaster.library/xadHookTagAccess         xadmaster.library/xadHookTagAccess
  1083.  
  1084.     NAME
  1085.         xadHookTagAccess - a client only function to get/store data (V3)
  1086.  
  1087.     SYNOPSIS
  1088.         result = xadHookTagAccessA(command, data, buffer, ai, tags)
  1089.         D0                           D0      D1     A0    A1   A2
  1090.  
  1091.         LONG xadHookTagAccessA(ULONG, LONG, APTR, struct xadArchiveInfo *,
  1092.              const struct TagItem *)
  1093.  
  1094.         result = xadHookTagAccess(command, data, buffer, ai, tag1, ...)
  1095.  
  1096.         LONG xadHookTagAccess(ULONG, LONG, APTR, struct xadArchiveInfo *,
  1097.              Tag, ...)
  1098.  
  1099.     FUNCTION
  1100.         This function equals xadHookAccess() but allows to use tags to get
  1101.         better control. This includes CRC creation and use of xadSkipInfo
  1102.         system.
  1103.  
  1104.     INPUT
  1105.         command - one of the XADAC commands to control hook
  1106.         data    - the required data, mostly a size value
  1107.         buffer  - the input/output buffer for read and write
  1108.         ai      - the master communication structure
  1109.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  1110.                   XAD_CRC16ID, XAD_CRC32ID, XAD_GETCRC16, XAD_GETCRC32,
  1111.                   XAD_USESKIPINFO, XAD_SECTORLABELS
  1112.  
  1113.     RESULT
  1114.         result  - any of the XADERR codes or zero when all is ok.
  1115.  
  1116.     SEE ALSO
  1117.         libraries/xadmaster.h, xadHookAccess(), tags section
  1118.  
  1119. xadmaster.library/xadRecogFile                 xadmaster.library/xadRecogFile
  1120.  
  1121.     NAME
  1122.         xadRecogFile - check if a file is an archive file or not
  1123.  
  1124.     SYNOPSIS
  1125.         client = xadRecogFileA(size, memory, tags)
  1126.         D0                     D0     A0     A1
  1127.  
  1128.         struct xadClient *xadRecogFileA(ULONG, APTR, const struct TagItem *)
  1129.  
  1130.         client = xadRecogFile(size, memory, tag1, ...)
  1131.  
  1132.         struct xadClient *xadRecogFile(ULONG, APTR, Tag, ...)
  1133.  
  1134.     FUNCTION
  1135.         This function can be used to check if a file is a archive or not.
  1136.         It has only limited abilities! You need to pass a pointer to
  1137.         memory of recogsize. The recogsize value can be found in
  1138.         xadMasterBase. If the file is shorter, use the complete file as
  1139.         buffer. Longer buffers are allowed as well. When the file is
  1140.         archived, you get back a pointer to the client which detected the
  1141.         file. If not, the return is zero. The only usable information
  1142.         should be the name of the client. To get more information and all
  1143.         archive related data you have to use xadGetInfo(), which calls
  1144.         xadRecogFile internal itself.
  1145.  
  1146.         Normally this function is not needed by application programs. It
  1147.         is used in xadList utility. This function is useful for tools
  1148.         only detecting and displaying the archiver type.
  1149.  
  1150.     INPUT
  1151.         size    - size of the memory region
  1152.         memory  - pointer to the memory holding the file
  1153.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  1154.                   XAD_NOEXTERN, XAD_IGNOREFLAGS, XAD_ONLYFLAGS
  1155.  
  1156.     RESULT
  1157.         client  - pointer to client structure or zero when no archive
  1158.  
  1159.     SEE ALSO
  1160.         libraries/xadmaster.h, xadGetInfo(), tags section
  1161.  
  1162. xadmaster.library/--tags--                         xadmaster.library/--tags--
  1163.  
  1164.     TAGS FOR xadAllocObject()
  1165.  
  1166.       XAD_OBJBLOCKENTRIES       (ULONG)
  1167.         Can be specified together with XADOBJ_DISKINFO. This allocates
  1168.         memory for xdi_BlockInfo. Data field of tag item contains number
  1169.         of required blocks. Memory gets freed automatically, when object
  1170.         is freed.
  1171.  
  1172.       XAD_OBJCOMMENTSIZE        (ULONG)
  1173.         Like XAD_OBJNAMESIZE, but allocates memory for xfi_Comment entry.
  1174.  
  1175.       XAD_OBJNAMESIZE           (ULONG)
  1176.         Can be specified together with XADOBJ_FILEINFO. This allocates
  1177.         memory for storing file name. The required size has to be stored
  1178.         in data field of tag item. The allocated memory pointer is stored
  1179.         in xfi_FileName field of returned structure. Memory gets freed
  1180.         automatically, when object is freed.
  1181.  
  1182.       XAD_OBJPRIVINFOSIZE       (ULONG)
  1183.         Can be specified together with XADOBJ_FILEINFO and XADOBJ_DISKINFO.
  1184.         This allocates longword aligned client private buffer, which is
  1185.         stored in xfi_PrivateInfo or xdi_PrivateInfo field. The required
  1186.         size has to be stored in data field of tag item. Memory gets freed
  1187.         automatically, when object is freed.
  1188.  
  1189.     INPUT TAGS FOR xadGetHookAccess()
  1190.  
  1191.       XAD_INDEVICE             (struct xadDeviceInfo *) (V11)
  1192.         Use this tag to specify the device where data should be read from.
  1193.         In xdi_DOSName the DOS device must be stored, which must not be
  1194.         terminated with a ':' character.
  1195.         Alternatively in fields xdi_DeviceName and xdi_Unit the wanted
  1196.         device must be specified. The device must support TD_GETGEOMETRY
  1197.         command as the hook needs at least the blocksize for internal
  1198.         buffering.
  1199.         NOTE: When xdi_DeviceName and xdi_Unit is used, the hook cannot
  1200.         perform an Inhibit operation and thus it cannot prevent other
  1201.         tasks from accessing the device.
  1202.         I suggest always using xdi_DOSName field!
  1203.       
  1204.       XAD_INDISKARCHIVE        (const struct TagItem *) (V4)
  1205.     This hook allows to supply a disk archive as input source for
  1206.     file extraction from disk image files. You need to pass a
  1207.     pointer to a tagitem list (finished with TAG_DONE!) as data.
  1208.     This list is passed to xadGetInfo(). It may contain any of the
  1209.     tags supported by that function and must contain any of the
  1210.     input hook tags! Additionally it may contain XAD_ENTRYNUMBER
  1211.     to specify the entry, which should be used! If not, the first
  1212.     entry is used!
  1213.  
  1214.       XAD_INFILEHANDLE          (BPTR)
  1215.         FileHandle to get data from. It is not necessary that the handle
  1216.         is at the beginning of the file.
  1217.  
  1218.       XAD_INFILENAME            (STRPTR)
  1219.         Name of the input file.
  1220.  
  1221.       XAD_INHOOK                (struct Hook *)
  1222.         This enables any other way of data delivering. See special
  1223.         chapter on I/O hook functions.
  1224.  
  1225.       XAD_INMEMORY              (STRPTR)
  1226.         Pointer to a memory buffer holding the input data. You need to
  1227.         specify XAD_INSIZE when using this.
  1228.  
  1229.       XAD_INSIZE                (ULONG)
  1230.         Specify the size of input data. Must be used together with
  1231.         XAD_INMEMORY. Can be used together with other hooks.
  1232.  
  1233.       XAD_INSPLITTED            (struct xadSplitFile *) (V2)
  1234.         For multivolume archives it is necessary to supply multiple files.
  1235.         This tag allows to pass multiple input streams of any type in a
  1236.         linked list of xadSplitFile structures. The clients see that as
  1237.         one single continous stream (except that ai->xai_MultiVolume
  1238.         contains a field with size information for every part).
  1239.         Each entry must contain one of the other input types and the
  1240.         corresponding data. Also the size can be or must be (XAD_INMEMORY)
  1241.         passed in xadSplitFile structure.
  1242.         Clients could expect the parts in it correct order, but should be
  1243.         able to handle missing or corrupted part.
  1244.  
  1245.       XAD_INXADSTREAM        (const struct TagItem *) (V8)
  1246.     This allows to use an already existing XAD data stream as input for
  1247.     new calls. Can be used from clients to work with embedded archives
  1248.     in other archives. Do not touch the data yourself with
  1249.     xadHookAccess() until you released the secondary use with 
  1250.     xadFreeInfo()! At least XAD_ARCHIVEINFO must be supplied. Other tags
  1251.     of xadHookTagAccess() are supported as well. CRC-Pointers must be
  1252.     valid until xadFreeInfo()!
  1253.  
  1254.     OUTPUT TAGS FOR xadGetHookAccess()
  1255.  
  1256.       XAD_IGNOREGEOMETRY        (BOOL)
  1257.         This forces the device hook to use devices with different drive
  1258.         geometry than the one on disk archive. Most time this will produce
  1259.         useless disks. If not set the progress hook may get asked if
  1260.         geometry should be ignored or not (if there is one).
  1261.  
  1262.       XAD_FORMAT                (BOOL) (V5)
  1263.         Turns on formating of output device. This is turned off by default.
  1264.  
  1265.       XAD_MAKEDIRECTORY         (BOOL)
  1266.         Create missing directory tree when necessary. If not set the
  1267.         progress hook may get asked if directory should be created or
  1268.         not (if there is one).
  1269.  
  1270.       XAD_NOKILLPARTIAL        (BOOL) (V3.3)
  1271.     If this is set to true, partial or corrupted files get not deleted.
  1272.     This has effect only for file output hook and only if the filename
  1273.     was passed (and not the FileHandle pointer).
  1274.  
  1275.       XAD_OUTDEVICE             (struct xadDeviceInfo *)
  1276.         For disk archives it is useful to store data directly on a disk.
  1277.         Use this tag to specify the device where data should be stored.
  1278.         In xdi_DOSName the DOS device must be stored, which must not be
  1279.         terminated with a ':' character.
  1280.         Alternatively in fields xdi_DeviceName and xdi_Unit the wanted
  1281.         device must be specified. The device must support TD_GETGEOMETRY
  1282.         command, even if XAD_IGNOREGEOMETRY is turned on, as the hook
  1283.         needs at least the blocksize for internal buffering.
  1284.         NOTE: When xdi_DeviceName and xdi_Unit is used, the hook cannot
  1285.         perform an Inhibit operation and thus it cannot prevent other
  1286.         tasks from accessing the device. Also a DOS device is not updated,
  1287.         so a DiskChange becomes necessary.
  1288.         I suggest always using xdi_DOSName field!
  1289.       
  1290.       XAD_OUTFILEHANDLE         (BPTR)
  1291.         FileHandle to send data to. It is not necessary that the handle
  1292.         is at the beginning of the file.
  1293.  
  1294.       XAD_OUTFILENAME           (STRPTR)
  1295.         Name of the output file.
  1296.  
  1297.       XAD_OUTHOOK               (struct Hook *)
  1298.         This enables any other way of data storing. See special chapter
  1299.         on I/O hook functions.
  1300.  
  1301.       XAD_OUTMEMORY             (STRPTR)
  1302.         Pointer to a memory buffer to store data in. You need to specify
  1303.         XAD_OUTSIZE when using this.
  1304.  
  1305.       XAD_OUTSIZE               (ULONG)
  1306.         Specify the maximum size of output data. Must be used together with
  1307.         XAD_OUTMEMORY.
  1308.  
  1309.       XAD_OUTXADSTREAM        (const struct TagItem *) (V8)
  1310.     This allows to use an already existing XAD data stream as output for
  1311.     new calls. Can be used from clients to work with embedded archives
  1312.     in other archives. Do not touch the data yourself with
  1313.     xadHookAccess() until you released the secondary use with 
  1314.     xadFreeInfo()! At least XAD_ARCHIVEINFO must be supplied. Other tags
  1315.     of xadHookTagAccess() are supported as well. 
  1316.  
  1317.       XAD_OVERWRITE             (BOOL)
  1318.         This forces the file hook to overwrite existing destination files.
  1319.         If not set the progress hook may get asked if files should be
  1320.         overwritten or not (if there is one).
  1321.  
  1322.       XAD_PROGRESSHOOK          (struct Hook *)
  1323.         The progress hook for status displays. See special progress hook
  1324.         chapter for more information. Starting with V10 the progress hook
  1325.         is used during list creation also (if client supports this). If
  1326.         passed to the GetInfo functions for this purpose, keep in mind, that
  1327.         the pointer is still valid when using the unarchiving functions
  1328.         later. Thus you either need to overwrite the hook with a new
  1329.         progress hook or pass NULL to disable the hook if it should not be
  1330.         used after the GetInfo function completed.
  1331.  
  1332.       XAD_USESECTORLABELS    (BOOL) (V9)
  1333.     This turns on the storage of sector labels for disk hook. This means
  1334.     also CMD_WRITE is replaced by trackdisk.device command ETD_WRITE,
  1335.     which may not be supported by all device drivers. This is turned off
  1336.     by default.
  1337.  
  1338.       XAD_VERIFY                (BOOL)
  1339.         Turns on verify for device output. This is turned off by default.
  1340.  
  1341.     TAGS FOR xadConvertDates()
  1342.  
  1343.       XAD_DATEUNIX              (ULONG)
  1344.         Input is an UNIX date value (seconds starting with 01.01.1970).
  1345.  
  1346.       XAD_DATEAMIGA             (ULONG)
  1347.         Input as an Amiga date value (seconds starting with 01.01.1978).
  1348.  
  1349.       XAD_DATEDATESTAMP         (struct DateStamp *)
  1350.         Input is a pointer to an Amiga DateStamp structure.
  1351.     struct DateStamp
  1352.     {
  1353.       LONG     ds_Days;   /* Number of days since 01.01.1978 */
  1354.       LONG     ds_Minute; /* Number of minutes past midnight */
  1355.       LONG     ds_Tick;   /* Number of ticks (50 per sec) past minute */
  1356.     };
  1357.  
  1358.       XAD_DATEXADDATE           (struct xadDate *)
  1359.         Input is a pointer to a xadmaster date structure.
  1360.  
  1361.       XAD_DATECLOCKDATA         (struct ClockData *)
  1362.         Input is a pointer to a ClockData structure.
  1363.     struct ClockData
  1364.     {
  1365.       UWORD sec;
  1366.       UWORD min;
  1367.       UWORD hour;
  1368.       UWORD mday;
  1369.       UWORD month;
  1370.       UWORD year;
  1371.       UWORD wday;
  1372.     };
  1373.  
  1374.       XAD_DATECURRENTTIME       (void)
  1375.         Current system time value should be used as input.
  1376.  
  1377.       XAD_DATECPM        (UBYTE[5]) (V10)
  1378.     Input is an CP/M date field:
  1379.         UWORD   day     ;days starting with 01.01.1978 (==1), Intel byte order
  1380.         UBYTE   hour    ;Packed BCD
  1381.         UBYTE   minute  ;Packed BCD
  1382.         UBYTE   second  ;Packed BCD
  1383.  
  1384.       XAD_DATECPM2        (ULONG) (V10)
  1385.     Input is an CP/M date field:
  1386.         Bit 0..4 is half second (25 = second 49 or 50), 5..10 is minute,
  1387.         11..15 is hour,16..31 is days starting with 01.01.1978 (==1).
  1388.  
  1389.       XAD_DATEISO9660        (UBYTE[7]) (V11)
  1390.     Date structure of ISO9660 CD filesystem.
  1391.         UBYTE Number of years since 1900
  1392.         UBYTE Month of the year (1...12)
  1393.         UBYTE Day of the month (1...31)
  1394.         UBYTE Hour of the day (0...23)
  1395.         UBYTE Minute of the hour (0...59)
  1396.         UBYTE Second of the minute (0...59)
  1397.         The following field is ignored (which may change in future versions)
  1398.         and maybe zero if unknown.
  1399.         BYTE  Offset from GMT in 15 minute intervals (-48...52)
  1400.  
  1401.       XAD_DATEMAC               (ULONG) (V8)
  1402.         Input as an MacIntosh date value (seconds starting with 01.01.1904).
  1403.  
  1404.       XAD_DATEMSDOS             (ULONG) (V2)
  1405.         Input is an 32 bit packed date format used by MS-DOS. This means:
  1406.         Bit 0..4 is half second (25 = second 49 or 50), 5..10 is minute,
  1407.         11..15 is hour, 16..20 is day, 21..24 is month (1 = january) and
  1408.         25..31 is year (0 = year 1980). This format is used for archivers
  1409.         like RAR or Zip.
  1410.  
  1411.       XAD_GETDATEUNIX           (ULONG *)
  1412.         An UNIX time value should be stored in the ULONG variable, the
  1413.         supplied pointer points to.
  1414.  
  1415.       XAD_GETDATEAMIGA          (ULONG *)
  1416.         An Amiga time value should be stored in the ULONG variable, the
  1417.         supplied pointer points to.
  1418.  
  1419.       XAD_GETDATEDATESTAMP      (struct DateStamp *)
  1420.         The date should be stored in DateStamp structure the supplied
  1421.         pointer points to.
  1422.  
  1423.       XAD_GETDATEXADDATE        (struct xadDate *)
  1424.         The date should be stored in xadmaster date structure the supplied
  1425.         pointer points to.
  1426.  
  1427.       XAD_GETDATECLOCKDATA      (struct ClockData *)
  1428.         The date should be stored in ClockData structure the supplied
  1429.         pointer points to.
  1430.  
  1431.       XAD_GETDATECPM        (UBYTE[5]) (V10)
  1432.     The CP/M date is stored in the buffer pointer to by supplied pointer.
  1433.  
  1434.       XAD_GETDATECPM2           (ULONG *) (V10)
  1435.         The CP/M packed date should be stored in the ULONG variable, the
  1436.         supplied pointer points to.
  1437.  
  1438.       XAD_GETDATEISO9660        (UBYTE[7]) (V11)
  1439.         The ISO9660 date structure is filled. The GMT offset is ignored and
  1440.         filled with zero. This may change in future versions.
  1441.  
  1442.       XAD_GETDATEMAC            (ULONG *) (V8)
  1443.         An MacIntosh time value should be stored in the ULONG variable, the
  1444.         supplied pointer points to.
  1445.  
  1446.       XAD_GETDATEMSDOS          (ULONG *) (V2)
  1447.         An MS-DOS packed date value should be stored in the ULONG variable,
  1448.         the supplied pointer points to.
  1449.  
  1450.       XAD_MAKEGMTDATE           (BOOL)
  1451.         This forces the function to subtract the GMT offset supplied by
  1452.         locale.library to convert a local date to GMT date. Opening
  1453.         locale.library is required for that. When it cannot be openend or
  1454.         the offset would cause a overrun or underrun in the xd_Year field,
  1455.         no offset will be used. 
  1456.       
  1457.       XAD_MAKELOCALDATE         (BOOL)
  1458.         This forces the function to add the GMT offset supplied by
  1459.         locale.library to convert a GMT date to a local date. Opening
  1460.         locale.library is required for that. When it cannot be openend or
  1461.         the offset would cause a overrun or underrun in the xd_Year field,
  1462.         no offset will be used.
  1463.  
  1464.     TAGS FOR xadHookTagAccess() (V3)
  1465.  
  1466.       XAD_CRC16ID               (UWORD)
  1467.         This tag specifies the CRC-ID, which should be used for CRC16
  1468.         calculation. The default value is XADCRC16_ID1.
  1469.  
  1470.       XAD_CRC32ID               (ULONG)
  1471.         This tag specifies the CRC-ID, which should be used for CRC32
  1472.         calculation. The default value is XADCRC32_ID1.
  1473.  
  1474.       XAD_GETCRC16              (UWORD *)
  1475.         A pointer to a UWORD variable holding the CRC start value and after
  1476.         calling xadHookTagAccess() the final CRC value. CRC checks are done
  1477.         for XADAC_COPY, XADAC_READ and XADAC_WRITE.
  1478.  
  1479.       XAD_GETCRC32              (ULONG *)
  1480.         Like XAD_GETCRC16, but for 32 bit checksums.
  1481.  
  1482.       XAD_SECTORLABLES        (APTR) (V9)
  1483.     This tag allows to pass sector label information with XADAC_WRITE.
  1484.     There are some restrictions when passing them. First the data size
  1485.     must be a multiple of 512 and second the number of sector labels
  1486.     must match the number of 512 byte blocks. A sector label has the
  1487.     size of 16 byte! When e.g. passing a normal disk cylinder with
  1488.     11*2*512 byte (11264 byte), you need to pass a block to 11*2*16 byte
  1489.     (352 byte) with this tag. The sector labels are passed in one block
  1490.     always.
  1491.  
  1492.       XAD_USESKIPINFO           (BOOL)
  1493.         The field xadSkipInfo of xadArchiveInfo structure is used to skip
  1494.         parts of the input stream for read, copy and input seek operations.
  1495.         Whenever this tag is used, then the contents of the xai_SkipInfo
  1496.         field is interpreted.
  1497.         The data parts specified in the list are skipped for read and seek
  1498.         operations, so that you get always continous data blocks. It does
  1499.         not ignore them totally, so file sizes and file position are not
  1500.         changed. So if you read 500 bytes and there is a 8 byte skip block
  1501.         in between, then file position increases by 508 byte, but you get
  1502.         500 byte data without the skipped data.
  1503.  
  1504.         xadSkipInfo information only affects operations in input stream!
  1505.  
  1506.         The entries of xadSkipInfo list must not overlap and there must be
  1507.         at least one byte between entries!
  1508.  
  1509.     TAGS FOR xadGetFilename() (V12)
  1510.  
  1511.       XAD_NOLEADINGPATH     (BOOL) (V12)
  1512.     This tag allows to strip a leading path from filenames. This means
  1513.     any combination of "/", "." and ".." from begin of the path part.
  1514.  
  1515.       XAD_NOTRAILINGPATH        (BOOL) (V12)
  1516.     This tag allows to strip any trailing "/" from the resulting
  1517.     filename.
  1518.  
  1519.       XAD_MASKCHARACTERS        (STRPTR) (V12)
  1520.     This tag allows to set characters which should be replaced by the
  1521.     masking character in resulting filename.
  1522.     Default values are the characters from 0x01 to 0x1F, 0x7F to 0xA0
  1523.     and the characters #, ?, (, ), [, ], ~, %, *, :, |, ". These
  1524.     defaults are the characters, which make trouble with the Amiga
  1525.     filesystems.
  1526.  
  1527.       XAD_MASKINGCHAR           (UBYTE) (V12)
  1528.     This tags sets the masking character, which replaces masked
  1529.     characters. Default is the character '_'.
  1530.  
  1531.       XAD_REQUIREDBUFFERSIZE    (ULONG *) (V12)
  1532.         This tag expects an pointer to an ULONG variable, which after calling
  1533.         xadGetFilename contains the required buffer size (including the zero
  1534.         byte). This is especially useful if XADERR_SHORTBUFFER is returned
  1535.         in case the buffer was too short.
  1536.  
  1537.     TAGS FOR xadConvertName() (V12)
  1538.  
  1539.       XAD_ADDPATHSEPERATOR    (BOOL) (V12)
  1540.     This tag allows to toggle behaviour when joining two strings. The
  1541.     default is to add a path seperator '/' between them. Setting this
  1542.     value to FALSE before passing the second part omits the seperator
  1543.     between strings.
  1544.  
  1545.       XAD_CHARACTERSET        (ULONG) (V12)
  1546.     This tag specifies the character set of next XAD_CSTRING or
  1547.     XAD_PSTRING. Default is CHARSET_ISO_8859_1 encoding. All the encodings
  1548.     can be found in include file.
  1549.  
  1550.       XAD_CSTRING        (APTR) (V12)
  1551.     This is a normal zero terminated C-like string in previous defined
  1552.     encoding. This also may include unicode strings.
  1553.  
  1554.       XAD_PATHSEPERATOR        (UWORD *) (V12)
  1555.         This tag allows to supply a field of UWORD values containing path
  1556.         seperators in input encoding. Default are the values '/' and , '\'.
  1557.         The last entry of the field must be zero.
  1558.         
  1559.       XAD_PSTRING        (STRPTR) (V12)
  1560.     This is a Pascal-like string, where the first byte contains the
  1561.     string size. This type supports no multibyte encodings.
  1562.  
  1563.       XAD_STRINGSIZE        (ULONG) (V12)
  1564.     This tag allows to tell the maximum size of next supplied string
  1565.     (XAD_CSTRING, XAD_PSTRING or XAD_XADSTRING). If the string is shorter,
  1566.     this tag is ignored. The field ONLY affects the next string. None
  1567.     string tags are not counted.
  1568.  
  1569.       XAD_XADSTRING        (APTR) (V12)
  1570.     This tag is used to supply an XAD style string returned from a
  1571.     call to xadConvertName(). These strings carry information about
  1572.     encoding inside, so XAD_CHARACTERSET tag settings are ignored. Also
  1573.     the internal representation of the string may differ from the actual
  1574.     visible part in case the encoding could not represent the characters.
  1575.         This is useful to preserve ANY source information. If this is not
  1576.         wanted, any XAD string can be passed as XAD_CSTRING with the correct
  1577.         characterset encoding information. In this case only the visible part
  1578.         is interpreted.
  1579.  
  1580.     TAGS FOR xadConvertProtection() (V4)
  1581.  
  1582.       XAD_GETPROTAMIGA        (ULONG *)
  1583.     This tag is used to get the computed protection bits in Amiga format
  1584.     including the multiuser bits.
  1585.  
  1586.       XAD_GETPROTFILEINFO    (struct xadFileInfo *) (V11)
  1587.     This is the preferred way to store protection bits in xadFileInfo
  1588.     structures. It takes care of UNIX and MSDOS protection bits as well.
  1589.  
  1590.       XAD_GETPROTMSDOS        (ULONG *) (V11)
  1591.     This tag is used to get the computed protection bits in MSDOS format.
  1592.  
  1593.       XAD_GETPROTUNIX        (ULONG *) (V11)
  1594.     This tag is used to get the computed protection bits in UNIX format.
  1595.  
  1596.       XAD_PROTAMIGA        (ULONG)
  1597.     Input bits of Amiga style. This tag is useful together with other
  1598.     tags only. Archives containing Amiga protection without multiuser
  1599.     bits and Unix bits may be converted this way: "XAD_PROTAMIGA,
  1600.     amigabits, XAD_PROTUNIX, unixbits, XAD_GETPROTAMIGA, &amigabits".
  1601.     Now the multiuser bits are inluded.
  1602.     Specifying this tag always resets Amiga calculation! It may be used
  1603.     to reset the default bits as well. Specifying and XAD_PROTxxx tags
  1604.     in front of this one is really useless.
  1605.  
  1606.       XAD_PROTFILEINFO        (struct xadFileInfo *) (V11)
  1607.     Input is a pointer to a xadFileInfo structure. All 2 fields of this
  1608.     structure are used as input. This is the best way to get protection
  1609.     bits on non-Amiga systems.
  1610.  
  1611.       XAD_PROTMSDOS        (ULONG)
  1612.     Input bits of MSDOS style: 0 = read only, 1 = hidden, 2 = system,
  1613.     3 = volumename, 4 = directory, 5 = archived
  1614.     Only "r,w,a,d" bits of Amiga style are affected.
  1615.  
  1616.       XAD_PROTUNIX        (ULONG)
  1617.     Input bits of UNIX style: 0 = other execute, 1 = other write,
  1618.     2 = other read, 3 = group execute, 4 = group write, 5 = group read,
  1619.     6 = execute, 7 = write, 8 = read
  1620.     This affects the "r,w,e" and the multiuser bits of Amiga style.
  1621.  
  1622.     TAGS FOR different functions
  1623.  
  1624.       XAD_ARCHIVEINFO        (struct xadArchiveInfo *) (V8)
  1625.     This must be used to supply archive info with XAD_OUTXADSTREAM and
  1626.     XAD_INXADSTREAM.
  1627.  
  1628.       XAD_ENTRYNUMBER           (ULONG)
  1629.         This flag specifies the wanted entry. You must not specify more
  1630.         or less than one of that flag for every call to xadFileUnArc(),
  1631.         xadDiskFileUnArc() or xadDiskUnArc(). Normally this flag equals
  1632.         the element xdi_EntryNumber for currently parsed xadDiskInfo
  1633.         structure and xfi_EntryNumber for currently parsed xadFileInfo
  1634.         structure. The only assumption about entry numbers is, that they
  1635.         are unique! The entries must not be in any order, when parsed.
  1636.  
  1637.       XAD_ERRORCODE        (LONG *) (V12)
  1638.     Used for xadConvertName() function to return a error code which
  1639.     probably occured. If this tag is not used, you have no possibility
  1640.     to find problems, which cause no total failure of the function.
  1641.  
  1642.       XAD_HIGHCYLINDER          (ULONG)
  1643.         It specifies the highest cylinder which should be unarchived for
  1644.         xadDiskUnArc().
  1645.  
  1646.       XAD_IGNOREFLAGS        (uLONG) (V11)
  1647.         When this is specified for xadGetInfo(), xadGetDiskInfo() or
  1648.         xadRecogFile(), the library skips any clients, which do have
  1649.         the given flags set.
  1650.  
  1651.       XAD_INSERTDIRSFIRST    (BOOL) (V10)
  1652.     This tag can be used with xadAddFileEntry() and changes the
  1653.     behaviour, so that directory entries are alphabetically inserted
  1654.     at list start.
  1655.  
  1656.       XAD_LOWCYLINDER           (ULONG)
  1657.         It specifies the lowest cylinder which should be unarchived for
  1658.         xadDiskUnArc().
  1659.  
  1660.       XAD_NOEMPTYERROR        (BOOL) (V8)
  1661.     This one prevents production of XADERR_EMPTY, but instead
  1662.     xadGetDiskInfo() returns the empty file list. This is very useful
  1663.     together with XAD_STARTCLIENT tag.
  1664.  
  1665.       XAD_NOEXTERN              (BOOL)
  1666.         When this is specified for xadGetInfo(), xadGetDiskInfo() or
  1667.         xadRecogFile(), the library skips any external clients. Normally
  1668.         this should not be necessary. Some of the main clients are
  1669.         external as well (for legal reasons).
  1670.  
  1671.       XAD_ONLYFLAGS        (ULONG) (V11)
  1672.         When this is specified for xadGetInfo(), xadGetDiskInfo() or
  1673.         xadRecogFile(), the library skips any clients, which do NOT have
  1674.         the given flags set.
  1675.  
  1676.       XAD_PASSWORD              (STRPTR)
  1677.         You may supply a password for xadGetHookAccess() and related
  1678.         functions.
  1679.  
  1680.       XAD_SETINPOS        (ULONG) (V10)
  1681.     This may be used with xadAddFileEntry() and xadAddDiskEntry() to
  1682.     set the input file position after the entry was added. This is
  1683.     normally always necessary in case XADDIF_EXTRACTONBUILD or
  1684.     XADFIF_EXTRACTONBUILD is supported.
  1685.  
  1686.       XAD_STARTCLIENT        (struct xadClient *) (V7)
  1687.     As there may be multiple filesystems on one disk image file (e.g.
  1688.     standard AmigaOS filesystem hiding an other one), it is useful to
  1689.     rescan the file. If you call xadGetDiskInfo() with this tagitem
  1690.     set to the client which comes after the one found in previous run
  1691.     (ai->xai_Client->xc_Next), you may detect such double systems also.
  1692.     May be passed to xadGetDiskInfo().
  1693.  
  1694.       XAD_WASERROR        (LONG) (V8)
  1695.     Allows to supply an error number to xadFreeHookAccess(), which
  1696.     occured by accessing hooks. Supplying this results an calling the
  1697.     abort method of hooks.
  1698.  
  1699. xadmaster.library/-- data hooks--            xadmaster.library/--data hooks--
  1700.  
  1701.     GENERAL
  1702.         You have four methods of passing data to xadmaster.library: file-
  1703.         names, filehandles, memory areas and hooks. The hooks are described
  1704.         here. The hook field h_Entry has to be standard hook functions and
  1705.         gets called with the hook itself in A0 and a pointer to a
  1706.         xadHookParam in A1. Commands are stored in xhp_Command field, data
  1707.         in the other fields. Return values are 0 or any of the XADERR codes.
  1708.         Unsupported commands are returned with XADERR_NOTSUPPORTED.
  1709.  
  1710.         You may store a pointer to private data in the field xhp_PrivatePtr.
  1711.         You always get a XADHC_FREE after work to enable you freeing your
  1712.         resources.
  1713.  
  1714.         Whenever an error occured, the hook gets called with XADHC_ABORT.
  1715.         Use this to delete partial file, free useless memory or whatever
  1716.         you used. You must not do cleanup stuff on XADHC_ABORT call, as 
  1717.         XADHC_FREE call follows after it.
  1718.         
  1719.         NOTE: Because hooks are not called in program environment, they
  1720.         cannot be used in small data model of some compilers, as register
  1721.         A4 is not passed through. So the hook either has to be compiled in
  1722.         large data model or should use __saveds keyword of some compilers.
  1723.  
  1724.     The field xhp_TagList may contain additional tags. Currently only
  1725.     XADAC_WRITE uses this.
  1726.  
  1727.     COMMANDS
  1728.       XADHC_READ                (input hooks only)
  1729.         This command is called all time xadmaster.library needs some data.
  1730.         Fill the supplied memory area with input data of needed size.
  1731.         Input:  xhp_BufferSize  size of required data
  1732.                 xhp_BufferPtr   buffer to fill
  1733.         Output: xhp_DataPos     buffer position after read
  1734.  
  1735.       XADHC_WRITE               (output hooks only)
  1736.         This function is called, if some data should be stored. Copy
  1737.         the contents of buffer to your data storing system.
  1738.         Input:  xhp_BufferSize  size of data
  1739.                 xhp_BufferPtr   pointer to memory area
  1740.         Output: xhp_DataPos     buffer position after write
  1741.         Tags:   xhp_TagList     may contain XAD_SECTORLABELS info
  1742.  
  1743.       XADHC_SEEK                (both)
  1744.         Change the current position in your data (like dos.library Seek
  1745.         command). The offset you have to seek is always relative to
  1746.         current position. It can be negative too. Seek's with size 0 can
  1747.         be used to get current file position.
  1748.         Input:  xhp_CommandData offset you have to seek
  1749.         Output: xhp_DataPos     buffer position after seek
  1750.  
  1751.       XADHC_INIT                (both)
  1752.         The work starts. Allocate needed structures and initialize your
  1753.         stuff. Clear xhp_BufferPos.
  1754.         Input:  none
  1755.         Output: none
  1756.  
  1757.       XADHC_FREE                (both)
  1758.         You get this when work is finished, free all your stuff now. You
  1759.         need to clear all pointers you use for checking, as it may happen
  1760.         that you get multiple XADHC_FREE commands.
  1761.         Input:  none
  1762.         Output: none
  1763.  
  1764.       XADHC_ABORT               (output hooks only)
  1765.         You get this when work was aborted, because an error occured.
  1766.         Free all work stuff. Buffers must be freed by later XADHC_FREE call.
  1767.         Be prepared to get multiple XADHC_ABORT commands.
  1768.         Input:  none
  1769.         Output: none
  1770.  
  1771.       XADHC_FULLSIZE            (input hooks only)
  1772.         The hook should return complete size of input data which should be
  1773.         processed.
  1774.         Input:  none
  1775.         Output: xhp_CommandData size of input file
  1776.  
  1777.       XADHC_IMAGEINFO        (input hooks only) (V4)
  1778.     The hook should return information about disk image file. Normally
  1779.     hooks return XADERR_NOTSUPPORTED for this, like for all unsupported
  1780.     commands. Only the internal disk archive hook is able to return
  1781.     useful data.
  1782.     Input:    xhp_CommandData contains pointer to xadImageInfo structure,
  1783.         which should be filled
  1784.     Output: xadImageInfo structure in xhp_CommandData is filled with data
  1785.  
  1786. xadmaster.library/-- progress hooks--    xadmaster.library/--progress hooks--
  1787.  
  1788.     GENERAL
  1789.         This hook can be used to do display completion reports or ask the
  1790.         user. It gets a pointer to a xadProgressInfo structure. The hook
  1791.         returns a combination of XADPIF flags. A return value without
  1792.         XADPIF_OK (mostly 0) means a break command. Normally a hook should
  1793.         check for <CTRL>-<C> presses (or any other break condition) and add a
  1794.         XADPIF_OK to return value when no break condition exists.
  1795.  
  1796.         A progress hook must not support all possibilities! For example hooks
  1797.         from file unarchiving utilities never need an XADPIF_IGNOREGEOMETRY
  1798.         check. Also they need not support renaming or any other stuff. But
  1799.         the more they support, the better the user can work with the tool!
  1800.  
  1801.     MODES
  1802.       XADPMODE_ASK
  1803.         The master library has some problems, which need user interaction.
  1804.         The implementation of the user interaction depends on the
  1805.         application. The xpi_Status holds information what question needs to
  1806.         be answered. When XADPIF_OVERWRITE is set, the hook must determine if
  1807.         the file should be overwritten, renamed or not. The return flags
  1808.         must be set corresponding to this decision. Same is for
  1809.         XADPIF_IGNORGEGEOMETRY and XADPIF_MAKEDIRECTORY flag.
  1810.  
  1811.         XADPIF_IGNOREGEOEMTRY
  1812.           The hook either returns XADPIK_OK|XADPIF_IGNOREGEOMETRY or only
  1813.           XADPIF_OK, when user doesn't think geometry can be ignored.
  1814.  
  1815.         XADPIF_MAKEDIRECTORY
  1816.           The hook either returns XADPIK_OK|XADPIF_MAKEDIRECTORY or only
  1817.           XADPIF_OK, when user doesn't want to make directory.
  1818.  
  1819.         XADPIF_OVERWRITE
  1820.           The destination file already exists. The user should get 6 chances
  1821.           now (named with some standard letters).
  1822.           N - Do not do anything. The hook returns XADPIF_OK.
  1823.           Y - Turn overwrite on. The hook returns XADPIF_OK|XADPIF_OVERWRITE.
  1824.           A - Turn overwrite on for all files. The hook stores this
  1825.               information and returns XADPIF_OK|XADPIF_OVERWRITE. All
  1826.               following XADPIF_OVERWRITE requests are automatically answered
  1827.               with this return.
  1828.           S - Skip that file. The hook returns XADPIF_OK|XADPIF_SKIP.
  1829.           Q - Quit the program. The hook returns XADPIF_OK and the program
  1830.               quits before next call.
  1831.           R - The user wants to rename the file. The hook calls xadAllocVec()
  1832.               to get some memory for the name and passes this in xpi_NewName.
  1833.               This memory is freed by xadmaster.library afterwards!
  1834.               The return value is XADPIF_OK|XADPIF_RENAME.
  1835.  
  1836.         XADPIF_ISDIRECTORY
  1837.           The destination file already exists. The user should get 4 chances
  1838.           now (named with some standard letters).
  1839.           R - The user wants to rename the file. The hook calls xadAllocVec()
  1840.               to get some memory for the name and passes this in xpi_NewName.
  1841.               This memory is freed by xadmaster.library afterwards!
  1842.               The return value is XADPIF_OK|XADPIF_RENAME.
  1843.           N - Do not do anything. The hook returns XADPIF_OK.
  1844.           S - Skip that file. The hook returns XADPIF_OK|XADPIF_SKIP.
  1845.           Q - Quit the program. The hook returns XADPIF_OK and the program
  1846.               quits before next call.
  1847.  
  1848.       XADPMODE_END
  1849.         This is the last progress display with final results.
  1850.  
  1851.       XADPMODE_ERROR
  1852.         An error occured. The error value is in xpi_Error field.
  1853.  
  1854.       XADPMODE_PROGRESS
  1855.         Normal progress display. Depending on data type (disk/file), some
  1856.         progress information can be displayed.
  1857.  
  1858.       XADPMODE_NEWENTRY (V10)
  1859.     This indicates, that either a new file or disk entry has been added.
  1860.     If the flag XADDIF_EXTRACTONBUILD or XADFIF_EXTRACTONBUILD is set, the
  1861.     file maybe extracted immediately, although this is not recommended.
  1862.     Generally this can be used for progress displays and to abort
  1863.     scanning. The flag XADDIF_ENTRYMAYCHANGE or XADFIF_ENTRYMAYCHANGE
  1864.     indicate, that this entry may change until the GetInfo functions
  1865.     is finished.
  1866.  
  1867.       XADPMODE_GETINFOEND (V11)
  1868.     This indicates, that the GetInfo function finished and the progress
  1869.     hook will not receive any other XADPMODE_NEWENTRY report. But keep
  1870.     in mind, that the same hook is used for unarchiving also, if not
  1871.     overwritten by the unarchive calls!
  1872.  
  1873.     RETURN VALUES
  1874.       0 or anything without XADPIF_OK
  1875.         The work should be aborted. The master library returns XADERR_BREAK.
  1876.  
  1877.       XADPIF_OK
  1878.         No break condition occured. The normal return value for progress
  1879.         display. Also used when user choosed to answer NO to XADPMODE_ASK
  1880.         questions.
  1881.  
  1882.       XADPIF_OK|XADPIF_IGNOREGEOMETRY
  1883.         User choosed that drive geometry can be ignored.
  1884.  
  1885.       XADPIF_OK|XADPIF_MAKEDIRECTORY
  1886.         User choosed that directory should be created.
  1887.  
  1888.       XADPIK_OK|XADPIF_OVERWRITE
  1889.         User choosed that file should be overwritten.
  1890.  
  1891.       XADPIF_OK|XADPIF_RENAME
  1892.         User choosed that file should be renamed. The field xpi_NewName must
  1893.         contain a memory block allocated with xadAllocVec() which holds a new
  1894.         file name. This block is freed by xadmaster.library afterwards!
  1895.  
  1896.       XADPIF_OK|XADPIF_SKIP
  1897.         User choosed to skip that file. The master library returns XADERR_SKIP
  1898.         in that case.
  1899.  
  1900.